package org.niux.aims.action.ajax;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.niux.aims.common.web.AimsBaseAction;
import org.niux.aims.service.IAccountService;

/**
 * 
 * Copyright (c) 2009,niux<br>
 * All rights reserved.<br>
 * 
 * 文件名称：CheckPassword.java<br>
 * 摘    要：检查密码AJAX类<br>
 * <br>
 * 当前版本：<br>
 * 作    者：铭显 Email: <a href="mailto:liangmingxian@gmail.com">liangmingxian@gmail.com</a><br>
 * 完成日期：@since 2013-9-2<br>
 * <br>
 * 取代版本：<br>
 * 原作者  ：<br>
 * 完成日期：@since Oct 22, 2009<br>
 */
public class CheckPassword extends AimsBaseAction {

	private Log log = LogFactory.getLog(getClass());
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3744118153169080607L;
	
	@Resource(name="accountService")
	private IAccountService accountService;
	
	private boolean flag;
	private String id;
	private String password;
	
	/**
	 * 
	 * 方法概述：检查密码
	 * 描述：检查密码
	 * @return
	 * 返回类型：String
	 * 修改人：梁铭显
	 * 修改时间：2013-9-2
	 */
	public String checkPassword(){
		flag = accountService.checkPassword(Integer.parseInt(id), password);
		log.debug("========"+flag);
		return SUCCESS;
	}

	public boolean isFlag() {
		return flag;
	}

	public void setFlag(boolean flag) {
		this.flag = flag;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}
